<%@ include file="../header.jsp" %>
	<div id="content">
		<form:form action="categoryTransaction" method="post" commandName="transactionCategoryForm">
			<fieldset>
			<label>Seleccione la categoria para ver las transacciones correspondientes</label>
			<br>
				 <form:select path="category"><br>
						<form:options items="${categoryList}" itemValue="id" itemLabel="name"/> 
				</form:select><br>
				<input type="submit" value="Ir">
			</fieldset>
		</form:form>
		<br>
		<c:out value="${no_category}"></c:out>
		<br>
		<table border="1" bgcolor="lightBlue">
		<tr>
			<th><label>Comprador</label></th>
			<th><label>Vendedor</label></th>
			<th><label>Producto</label></th>
			<th><label>Fecha</label></th>
			<th><label>Cantidad</label></th>
			
		</tr>
			<c:forEach items="${transactionList}" var="transaction">
			<tr>
			<td>
			<a href="<c:url value=""><c:param name="buyer" value="${transaction.buyer.username}" /></c:url>">
							<c:out value="${transaction.buyer.username}" />
			</a>
			</td>
			<td>
			<a href="<c:url value=""><c:param name="seller" value="${transaction.seller.username}" /></c:url>">
							<c:out value="${transaction.seller.username}" />
			</a>
			</td>
			<td>
			<a href="<c:url value=""><c:param name="product" value="${transaction.product.name}" /></c:url>">
							<c:out value="${transaction.product.name}" />
			</a>
			</td>
			<td>
			<c:out value="${transaction.date}" />
			</td>
			<td>
			<c:out value="${transaction.quantity}" />
			</td>
			
			</tr>
			</c:forEach>
		</table>
	</div>
<%@ include file="../footer.jsp" %>